package com.mtsmda.jpa.run;

import javax.persistence.EntityManager;
import javax.persistence.Persistence;

public class OneToManyUniDirectionalServiceRun {

	public static void main(String[] args) {
		EntityManager entityManager = Persistence.createEntityManagerFactory(
				"MTSMDA").createEntityManager();
		entityManager.getTransaction().begin();

		// Address address = new Address("Moldova", "Kishinev",
		// "Stefan cel Mare", "149", "7");
		// Address address1 = new Address("Moldova", "Kishinev", "Puskin", "19",
		// "95");
		//
		// Person person = new Person("U U U");
		// person.getAddresses().add(address);
		// person.getAddresses().add(address1);
		//
		// entityManager.persist(person);

		// Address address2 = new Address("Moldova", "Kishinev", "G.Asachi",
		// "95", "18");
		//
		// Person person = new Person("G G G");
		// person.getAddresses().add(address2);
		//
		// entityManager.persist(person);

		// Address address3 = new Address("Moldova", "Kishinev", "S.Lazo", "18",
		// "5");
		// entityManager.persist(address3);
		//
		// Person person2 = new Person("L L L");
		// person2.getAddresses().add(address3);
		//
		// entityManager.persist(person2);

		entityManager.getTransaction().commit();
		entityManager.close();
	}

}